﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model_SSResourceManager;

namespace Presenter_SSResourceManager
{
    public class PresenterEditQueue
    {
        private readonly IViewEditQueue _viewEditQueue;
        private readonly ModelsManager _mModel;

        public PresenterEditQueue(IViewEditQueue view)
        {
            this._viewEditQueue = view;
            _mModel = ModelInstanse.Get();

        }
       
        public void FillFieldToEdit(Guid resourceId)
        {
            _viewEditQueue.FillPageFields(_mModel.queueModel.Get(resourceId));
        }

        public void Update()
        {
            Queue queue = _viewEditQueue.GatherPageFieldsInformation();
            _mModel.queueModel.Update(queue);
        }


        public string GetUserName(Guid guid)
        {
            return _mModel.userModel.GetUserName(guid);
        }

        public string GetResourceName(Guid guid)
        {
            return _mModel.resourceModel.GetResourceName(guid);
        }

    }
}
